/**
 * point_t* Typed Doubly Linked List
 * @file linked_list.h
 * @see http://code.google.com/p/mega8-hob/source/browse/trunk/linked_list.h
 * @author Hamish Cumming & Brian Thorne
 * @version see SVN revision number
 */
 #ifndef linked_list_h
#define linked_list_h
 
#include <stdlib.h>
#include "paver.h"

/**
 * A list node that contains data of type point 
 */
typedef struct list_node
{
    struct list_node * next;
    struct list_node * previous;
    point_t * point;
    
} list_node_t;

/**
 * A simple linked list.
 */
typedef struct 
{
    int nodes; //the number of nodes
    list_node_t * start_node;
    list_node_t * end_node;
} linked_list_t;

/* Add a new node to the list */
list_node_t * add_node (linked_list_t * ll, point_t * data);

/* Delete and free a list node (and the data) */
void delete_node(linked_list_t * ll, list_node_t * node);

/* Create a new linked list */
linked_list_t * linked_list_create(void);

#endif

